package main

import (
	"github.com/gogf/gf/frame/g"
	"github.com/gogf/gf/net/ghttp"
	_ "guli-shopping/api-service/router"
)

//跨域
func MiddlewareCORS(r *ghttp.Request) {
	//执行跨域请求处理
	r.Response.CORSDefault()
	//调用下一个中间件
	r.Middleware.Next()
}

func main() {
	server := g.Server()
	server.Use(MiddlewareCORS)
	server.SetPort(9001)
	server.Run()
}
